package parking.carvalho;

import java.io.Serializable;

import parking.Message;

/**
 * @author Sophie and Ronnie
 * @date 9 November 2013
 */
public class RequestClock implements Serializable {
	private static final long serialVersionUID = 735526215499735754L;
	
	private Message msg;
	private int hour;
	private int type;
	
	public RequestClock(Message msg, int hour, int type) {
		this.msg = msg;
		this.hour = hour;
		this.type = type;
	}
	
	public void setMsg(Message msg) {
		this.msg = msg;
	}
	
	public void setHour(int hour) {
		this.hour = hour;
	}
	
	public void setType(int type) {
		this.type = type;
	}
	
	public Message getMsg() {
		return msg;
	}

	public int getHour() {
		return hour;
	}

	public int getType() {
		return type;
	}
	
	@Override
	public String toString() {
		String stype = "";
		String sMsg = "";
		
		switch (type) {
		case 0 : 
			stype = "entrée";
			break;
			
		case 1 :
			stype = "sortie";
			break;
		}
		
		switch (this.msg) {
		case REL : 
			sMsg = "REL + UPDATE";
			break;
			
		case REQ : 
			sMsg = "REQ";
			break;
			
		default:
			break;
		}
		
		
		
		return sMsg + " | " + stype + " | H = " + this.hour;
	}
	
	

}
